<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<head>
<title>上传测试</title>
<script type="text/javascript" src="../js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="../js/jquery-form.js"></script>
<script type="text/javascript">
	function submitUpload() {
		var option = {
			url : "/pc-console/upload/uploadPic.do",
			type : "post",
			dataType : "text",
			data : {
				fileName : "imgsFile"
			},
			success : function(responseText) {
				alert(responseText);
				debugger;
				var obj = $.parseJSON(responseText);
				$("#imgsImgSrc").attr("src", obj.realPath);
				$("#imgs").val(obj.raltivePath);

			},
			error : function() {
				alert("系统错误");
			}
		}
		
		$('#form111').ajaxSubmit(option);
	}
</script>
</head>
<body id="main">
<div class="frameR">
	<div class="content">
		<form id="form111" name="form111" 
			method="post" enctype="multipart/form-data">
			<div class="edit set">

				<p>
					<label class="alg_t"><samp>*</samp>图片：</label><img
						id='imgsImgSrc' src="" height="100" width="100" />
				</p>
				<p>
					<input type='file' size='27' id='imgsFile'
						name='imgsFile' class="file" onchange='submitUpload()' /> <span
						id="submitImgTip" class="pos">请上传图片宽为120px，高为50px，大小不超过100K。</span>
					<input type='hidden' id='imgs' name='imgs' value='' reg2="^.+$"
						tip="亲！您忘记上传图片了。" /><span></span>
				</p>


				<p>
					<label>&nbsp;</label><input type="submit" name="button1" 
						class="hand btn83x23" value="完成" /><input type="button"
						class="hand btn83x23b" id="reset1" value='取消'
						onclick="backList()" />
				</p>
			</div>
		</form>
	</div>
</div>
</body>